package com.videoweb.entity.dto;


import com.videoweb.constant.Constants;
import com.videoweb.utils.DurationUtils;
import lombok.Data;

import java.time.LocalDate;

@Data
public class VideoItemDTO {
    private Long id;
    private String title;
    private String videoUrl;
    private String coverUrl;
//    记得转一下时间哈
    private String duration;
    private Integer views;
    private Integer likes;
    private Long userId;
    private String nickname;
    private String avatar;
//    转一下时间
//    private LocalDateTime createdAt;
    private LocalDate createdAt;



    public void setAvatar(String avatar) {
        this.avatar = Constants.CNAME +avatar;
    }

    //ok
    public void setDuration(String duration) {
        this.duration = DurationUtils.getTime(Long.parseLong(duration));
    }


    public void setVideoUrl(String videoUrl) {
        this.videoUrl = Constants.CNAME +videoUrl;
    }

    public void setCoverUrl(String coverUrl) {
        this.coverUrl = Constants.CNAME +coverUrl;
    }
}

